package gr.handmademarket.ui.tabs;

import gr.handmademarket.po.interfaces.Category;
import gr.handmademarket.ui.panels.ThumbnailsPanel;

import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

/**
 * Category tab.
 */
public class CategoryTab 
extends AbstractTab{

	/**
	 * serialVersionUID.
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * the local category.
	 */
	private Category category;

	/**
	 * Creates a new CategoryTab object. 
	 * @param categoryModel 
	 *
	 */
	public CategoryTab(IModel<Category> categoryModel) {
		super(new Model<String>(categoryModel.getObject().getName()));
		category = categoryModel.getObject();
	}

	@Override
	public Panel getPanel(String panelId) {
		ThumbnailsPanel panel = new ThumbnailsPanel(panelId, category);
		return panel;
	}	
}
